<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>05-多Echarts图表示例</title>
</head>

<body>
  <div id="main" style="width: 600px;height:400px;"></div>
  <div id="foo" style="width: 600px;height:400px;"></div>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.2/echarts.min.js"></script>
  <script>
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'))
    var myChartFoo = echarts.init(document.getElementById('foo'))
    // 使用刚指定的配置项和数据显示图表。
    // myChart.setOption(option);
    myChart.setOption({
      title: {
        text: '自己手动添加Echarts的参数---'
      },
      xAxis: {
        data: ['食品', '数码', '服饰', '箱包', '家电', '汽车', '饮料']
      },
      yAxis: {},
      series: {
        type: 'bar', // 柱状图
        data: [30, 37, 76, 63, 29, 88, 69]
      }
    })
    // 另一个图表
    myChartFoo.setOption({
      xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
      },
      // yAxis: {
      //   type: 'value'
      // },
      yAxis:{},
      series: [
        {
          data: [150, 230, 224, 218, 135, 147, 260],
          type: 'line'
        }
      ]
    })
  </script>
</body>

</html>